<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: MDNS</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__mdns.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">MDNS<div class="ingroups"><a class="el" href="group__apps.html">Applications</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__mdns__opts"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns__opts.html">Options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gab2edba12d5cad1949f7ca040ae12beec"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#gab2edba12d5cad1949f7ca040ae12beec">mdns_resp_netif_settings_changed</a>(<a class="el" href="structnetif.html">netif</a>)&#160;&#160;&#160;<a class="el" href="group__mdns.html#ga0f462fb91a9d0323bb4636bd725f0e85">mdns_resp_announce</a>(<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:gab2edba12d5cad1949f7ca040ae12beec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa619ac8f46a4b4021195720f0355cbeb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#gaa619ac8f46a4b4021195720f0355cbeb">mdns_resp_add_netif</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, const char *hostname, u32_t dns_ttl)</td></tr>
<tr class="separator:gaa619ac8f46a4b4021195720f0355cbeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa8144e3c77a92c4043e6214ff6b6010c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#gaa8144e3c77a92c4043e6214ff6b6010c">mdns_resp_remove_netif</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:gaa8144e3c77a92c4043e6214ff6b6010c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7b1473e595eb0c185bab293f3ec2e50e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga7b1473e595eb0c185bab293f3ec2e50e">mdns_resp_rename_netif</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, const char *hostname)</td></tr>
<tr class="separator:ga7b1473e595eb0c185bab293f3ec2e50e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga824e992e94be216c8e059f48f49a59ce"><td class="memItemLeft" align="right" valign="top">s8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga824e992e94be216c8e059f48f49a59ce">mdns_resp_add_service</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, <a class="el" href="mdns_8h.html#a3b9ee5953214665e585e5bcaf6b8ea83">service_get_txt_fn_t</a> txt_fn, void *txt_data)</td></tr>
<tr class="separator:ga824e992e94be216c8e059f48f49a59ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3df2ae751cdfdffb0a567390940eb8ad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga3df2ae751cdfdffb0a567390940eb8ad">mdns_resp_del_service</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, s8_t slot)</td></tr>
<tr class="separator:ga3df2ae751cdfdffb0a567390940eb8ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf273897059f1bbddc74cfcb820777dd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#gaf273897059f1bbddc74cfcb820777dd9">mdns_resp_rename_service</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, s8_t slot, const char *name)</td></tr>
<tr class="separator:gaf273897059f1bbddc74cfcb820777dd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01c85202f4b85edc8b571f2f419db576"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga01c85202f4b85edc8b571f2f419db576">mdns_resp_add_service_txtitem</a> (struct <a class="el" href="structmdns__service.html">mdns_service</a> *service, const char *txt, u8_t txt_len)</td></tr>
<tr class="separator:ga01c85202f4b85edc8b571f2f419db576"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f462fb91a9d0323bb4636bd725f0e85"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga0f462fb91a9d0323bb4636bd725f0e85">mdns_resp_announce</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:ga0f462fb91a9d0323bb4636bd725f0e85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93eccdc0d9afff0f24160d31c70e2c9a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga93eccdc0d9afff0f24160d31c70e2c9a">mdns_resp_restart</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:ga93eccdc0d9afff0f24160d31c70e2c9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5fa15978a398dae1a8d7620ae169bdd3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mdns.html#ga5fa15978a398dae1a8d7620ae169bdd3">mdns_resp_init</a> (void)</td></tr>
<tr class="separator:ga5fa15978a398dae1a8d7620ae169bdd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>RFC 6762 - Multicast DNS<br />
RFC 6763 - DNS-Based Service Discovery<br />
 </p><pre class="fragment">Multicast DNS for lwIP

Author: Erik Ekman


Note! The MDNS responder does not have all features required by the standards.
See notes in src/apps/mdns/mdns.c for what is left. It is however usable in normal
cases - but watch out if many devices on the same network try to use the same
host/service instance names.


How to enable:
==============

MDNS support does not depend on DNS.
MDNS supports using IPv4 only, v6 only, or v4+v6.

To enable MDNS responder, set
  LWIP_MDNS_RESPONDER = 1
in lwipopts.h and add src/apps/mdns/mdns.c to your list of files to build.

The max number of services supported per netif is defined by MDNS_MAX_SERVICES,
default is 1.

Increase MEMP_NUM_UDP_PCB by 1. MDNS needs one PCB.
Increase LWIP_NUM_NETIF_CLIENT_DATA by 1 (MDNS needs one entry on netif).

MDNS with IPv4 requires LWIP_IGMP = 1, and preferably LWIP_AUTOIP = 1.
MDNS with IPv6 requires LWIP_IPV6_MLD = 1, and that a link-local address is
generated.

The MDNS code puts its structs on the stack where suitable to reduce dynamic
memory allocation. It may use up to 1kB of stack.

MDNS (like other apps) needs a strncasecmp() implementation. If you have one, define
'lwip_strnicmp' to it. Otherwise the code will provide an implementation
for you.


How to use:
===========

Call mdns_resp_init() during system initialization.
This opens UDP sockets on port 5353 for IPv4 and IPv6.


To start responding on a netif, run
  mdns_resp_add_netif(struct netif *netif, char *hostname, u32_t dns_ttl)

The hostname will be copied. If this returns successfully, the netif will join
the multicast groups and any MDNS/legacy DNS requests sent unicast or multicast
to port 5353 will be handled:
- &lt;hostname&gt;.local type A, AAAA or ANY returns relevant IP addresses
- Reverse lookups (PTR in-addr.arpa, ip6.arpa) of netif addresses
  returns &lt;hostname&gt;.local
Answers will use the supplied TTL (in seconds)
MDNS allows UTF-8 names, but it is recommended to stay within ASCII,
since the default case-insensitive comparison assumes this.

Call mdns_resp_announce() every time the IP address on the netif has changed.

Call mdns_resp_restart() every time the network interface comes up after being
down, for example cable connected after being disconnected, administrative 
interface comes up after being down, or the device wakes up from sleep.

To stop responding on a netif, run
  mdns_resp_remove_netif(struct netif *netif)


Adding services:
================

The netif first needs to be registered. Then run
  mdns_resp_add_service(struct netif *netif, char *name, char *service,
      u16_t proto, u16_t port, u32_t dns_ttl,
      service_get_txt_fn_t txt_fn, void *txt_userdata);

The name and service pointers will be copied. Name refers to the name of the
service instance, and service is the type of service, like _http
proto can be DNSSD_PROTO_UDP or DNSSD_PROTO_TCP which represent _udp and _tcp.
If this call returns successfully, the following queries will be answered:
- _services._dns-sd._udp.local type PTR returns &lt;service&gt;.&lt;proto&gt;.local
- &lt;service&gt;.&lt;proto&gt;.local type PTR returns &lt;name&gt;.&lt;service&gt;.&lt;proto&gt;.local
- &lt;name&gt;.&lt;service&gt;.&lt;proto&gt;.local type SRV returns hostname and port of service
- &lt;name&gt;.&lt;service&gt;.&lt;proto&gt;.local type TXT builds text strings by calling txt_fn
  with the supplied userdata. The callback adds strings to the reply by calling
  mdns_resp_add_service_txtitem(struct mdns_service *service, char *txt,
   int txt_len). Example callback method:

   static void srv_txt(struct mdns_service *service, void *txt_userdata)
   {
     res = mdns_resp_add_service_txtitem(service, "path=/", 6);
     LWIP_ERROR("mdns add service txt failed\n", (res == ERR_OK), return);
   }

  Since a hostname struct is used for TXT storage each single item can be max
  63 bytes long, and  the total max length (including length bytes for each
  item) is 255 bytes.

If your device runs a webserver on port 80, an example call might be:

  mdns_resp_add_service(netif, "myweb", "_http"
      DNSSD_PROTO_TCP, 80, 3600, srv_txt, NULL);

which will publish myweb._http._tcp.local for any hosts looking for web servers,
and point them to &lt;hostname&gt;.local:80

Relevant information will be sent as additional records to reduce number of
requests required from a client.

To remove a service from a netif, run
  mdns_resp_del_service(struct netif *netif, s8_t slot)</pre><h2>Things left to implement: </h2>
<ul>
<li>Tiebreaking for simultaneous probing</li>
<li>Sending goodbye messages (zero ttl) - shutdown, DHCP lease about to expire, DHCP turned off...</li>
<li>Checking that source address of unicast requests are on the same network</li>
<li>Limiting multicast responses to 1 per second per resource record</li>
<li>Fragmenting replies if required</li>
<li>Handling multi-packet known answers</li>
<li>Individual known answer detection for all local IPv6 addresses</li>
<li>Dynamic size of outgoing packet </li>
</ul>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="gab2edba12d5cad1949f7ca040ae12beec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab2edba12d5cad1949f7ca040ae12beec">&#9670;&nbsp;</a></span>mdns_resp_netif_settings_changed</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define mdns_resp_netif_settings_changed</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="structnetif.html">netif</a></td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="group__mdns.html#ga0f462fb91a9d0323bb4636bd725f0e85">mdns_resp_announce</a>(<a class="el" href="structnetif.html">netif</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Announce IP settings have changed on netif. Call this in your callback registered by <a class="el" href="group__netif.html#gadc8787b23ac0ee023979cbadf87813d4">netif_set_status_callback()</a>. No need to call this function when LWIP_NETIF_EXT_STATUS_CALLBACK==1, this handled automatically for you. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface where settings have changed. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa619ac8f46a4b4021195720f0355cbeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa619ac8f46a4b4021195720f0355cbeb">&#9670;&nbsp;</a></span>mdns_resp_add_netif()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> mdns_resp_add_netif </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>hostname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32_t&#160;</td>
          <td class="paramname"><em>dns_ttl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Activate MDNS responder for a network interface. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to activate. </td></tr>
    <tr><td class="paramname">hostname</td><td>Name to use. Queries for &lt;hostname&gt;.local will be answered with the IP addresses of the netif. The hostname will be copied, the given pointer can be on the stack. </td></tr>
    <tr><td class="paramname">dns_ttl</td><td>Validity time in seconds to send out for IP address data in DNS replies </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if netif was added, an err_t otherwise </dd></dl>

</div>
</div>
<a id="ga824e992e94be216c8e059f48f49a59ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga824e992e94be216c8e059f48f49a59ce">&#9670;&nbsp;</a></span>mdns_resp_add_service()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s8_t mdns_resp_add_service </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>service</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum mdns_sd_proto&#160;</td>
          <td class="paramname"><em>proto</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32_t&#160;</td>
          <td class="paramname"><em>dns_ttl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="mdns_8h.html#a3b9ee5953214665e585e5bcaf6b8ea83">service_get_txt_fn_t</a>&#160;</td>
          <td class="paramname"><em>txt_fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>txt_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add a service to the selected network interface. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to publish this service on </td></tr>
    <tr><td class="paramname">name</td><td>The name of the service </td></tr>
    <tr><td class="paramname">service</td><td>The service type, like "_http" </td></tr>
    <tr><td class="paramname">proto</td><td>The service protocol, DNSSD_PROTO_TCP for TCP ("_tcp") and DNSSD_PROTO_UDP for others ("_udp") </td></tr>
    <tr><td class="paramname">port</td><td>The port the service listens to </td></tr>
    <tr><td class="paramname">dns_ttl</td><td>Validity time in seconds to send out for service data in DNS replies </td></tr>
    <tr><td class="paramname">txt_fn</td><td>Callback to get TXT data. Will be called each time a TXT reply is created to allow dynamic replies. </td></tr>
    <tr><td class="paramname">txt_data</td><td>Userdata pointer for txt_fn </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>service_id if the service was added to the netif, an err_t otherwise </dd></dl>

</div>
</div>
<a id="ga01c85202f4b85edc8b571f2f419db576"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga01c85202f4b85edc8b571f2f419db576">&#9670;&nbsp;</a></span>mdns_resp_add_service_txtitem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> mdns_resp_add_service_txtitem </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmdns__service.html">mdns_service</a> *&#160;</td>
          <td class="paramname"><em>service</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>txt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>txt_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call this function from inside the service_get_txt_fn_t callback to add text data. Buffer for TXT data is 256 bytes, and each field is prefixed with a length byte. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">service</td><td>The service provided to the get_txt callback </td></tr>
    <tr><td class="paramname">txt</td><td>String to add to the TXT field. </td></tr>
    <tr><td class="paramname">txt_len</td><td>Length of string </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if the string was added to the reply, an err_t otherwise </dd></dl>

</div>
</div>
<a id="ga0f462fb91a9d0323bb4636bd725f0e85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0f462fb91a9d0323bb4636bd725f0e85">&#9670;&nbsp;</a></span>mdns_resp_announce()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mdns_resp_announce </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send unsolicited answer containing all our known data </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to send on </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3df2ae751cdfdffb0a567390940eb8ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3df2ae751cdfdffb0a567390940eb8ad">&#9670;&nbsp;</a></span>mdns_resp_del_service()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> mdns_resp_del_service </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">s8_t&#160;</td>
          <td class="paramname"><em>slot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Delete a service on the selected network interface. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface on which service should be removed </td></tr>
    <tr><td class="paramname">slot</td><td>The service slot number returned by mdns_resp_add_service </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if the service was removed from the netif, an err_t otherwise </dd></dl>

</div>
</div>
<a id="ga5fa15978a398dae1a8d7620ae169bdd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5fa15978a398dae1a8d7620ae169bdd3">&#9670;&nbsp;</a></span>mdns_resp_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mdns_resp_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initiate MDNS responder. Will open UDP sockets on port 5353 </p>

</div>
</div>
<a id="gaa8144e3c77a92c4043e6214ff6b6010c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa8144e3c77a92c4043e6214ff6b6010c">&#9670;&nbsp;</a></span>mdns_resp_remove_netif()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> mdns_resp_remove_netif </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Stop responding to MDNS queries on this interface, leave multicast groups, and free the helper structure and any of its services. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to remove. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if netif was removed, an err_t otherwise </dd></dl>

</div>
</div>
<a id="ga7b1473e595eb0c185bab293f3ec2e50e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7b1473e595eb0c185bab293f3ec2e50e">&#9670;&nbsp;</a></span>mdns_resp_rename_netif()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> mdns_resp_rename_netif </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>hostname</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Update MDNS hostname for a network interface. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to activate. </td></tr>
    <tr><td class="paramname">hostname</td><td>Name to use. Queries for &lt;hostname&gt;.local will be answered with the IP addresses of the netif. The hostname will be copied, the given pointer can be on the stack. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if name could be set on netif, an err_t otherwise </dd></dl>

</div>
</div>
<a id="gaf273897059f1bbddc74cfcb820777dd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf273897059f1bbddc74cfcb820777dd9">&#9670;&nbsp;</a></span>mdns_resp_rename_service()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> mdns_resp_rename_service </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">s8_t&#160;</td>
          <td class="paramname"><em>slot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Update name for an MDNS service. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to activate. </td></tr>
    <tr><td class="paramname">slot</td><td>The service slot number returned by mdns_resp_add_service </td></tr>
    <tr><td class="paramname">name</td><td>The new name for the service </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if name could be set on service, an err_t otherwise </dd></dl>

</div>
</div>
<a id="ga93eccdc0d9afff0f24160d31c70e2c9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga93eccdc0d9afff0f24160d31c70e2c9a">&#9670;&nbsp;</a></span>mdns_resp_restart()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mdns_resp_restart </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Restart mdns responder. Call this when cable is connected after being disconnected or administrative interface is set up after being down </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The network interface to send on </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
